package org.edu.modules.teacher.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.edu.modules.teacher.entity.BaseTeacher;
import org.edu.modules.teacher.mapper.BaseTeacherMapper;
import org.edu.modules.teacher.service.IBaseTeacherService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Service
public class BaseTeacherServiceImpl extends ServiceImpl<BaseTeacherMapper, BaseTeacher> implements IBaseTeacherService {

    @Override
    public Map<String, String> listTeacherUserIdAndWorkNo() {
        List<BaseTeacher> list = list();
        return list.stream().collect(Collectors.toMap(BaseTeacher::getGh, BaseTeacher::getUserid));
    }

    @Override
    public Map<String, String> listTeacherUserIdAndIDCard() {
        List<BaseTeacher> list = list();
        return list.stream().collect(Collectors.toMap(BaseTeacher::getSfzjh, BaseTeacher::getUserid));
    }
}
